

<?
if(!isset($datoarray))
{
		$datoarray = array(
		'aar' => 400,
		'maaned' => 5,
		'dag' => 23,
        'time' => NULL,
        'minut' => NULL
		);
}
//	echo "Tid"; 

?>
<select style="width:50px" id="dag" class="dag" name="<? echo $dag;?>">
<?php 
	$available = 31;
    for($i = 1; $i <= $available; $i++) {
        
        ?><option value="<? echo $i; ?>" <? if($datoarray['dag'] == $i){ echo "selected='selected'"; } ?> ><? echo $i; ?></option>"<?
    }
?>
</select>


			<select style="width:90px" id="maaned" class="maaned" name="<? echo $maaned;?>">
				<option value="1" <? if($datoarray['maaned'] == 1){ echo "selected='selected'"; } ?>>januar</option>
				<option value="2" <? if($datoarray['maaned'] == 2){ echo "selected='selected'"; } ?>>februar</option>
				<option value="3" <? if($datoarray['maaned'] == 3){ echo "selected='selected'"; } ?>>marts</option>
				<option value="4" <? if($datoarray['maaned'] == 4){ echo "selected='selected'"; } ?>>april</option>
				<option value="5" <? if($datoarray['maaned'] == 5){ echo "selected='selected'"; } ?>>maj</option>
				<option value="6" <? if($datoarray['maaned'] == 6){ echo "selected='selected'"; } ?>>juni</option>
				<option value="7" <? if($datoarray['maaned'] == 7){ echo "selected='selected'"; } ?>>juli</option>
				<option value="8" <? if($datoarray['maaned'] == 8){ echo "selected='selected'"; } ?>>august</option>
				<option value="9" <? if($datoarray['maaned'] == 9){ echo "selected='selected'"; } ?>>september</option>
				<option value="10" <? if($datoarray['maaned'] == 10){ echo "selected='selected'"; } ?>>oktober</option>
				<option value="11" <? if($datoarray['maaned'] == 11){ echo "selected='selected'"; } ?>>november</option>
				<option value="12" <? if($datoarray['maaned'] == 12){ echo "selected='selected'"; } ?>>december</option>
			</select>



			<select style="width:60px" id="aar" name="<? echo $aar;?>">
				<?

				//echo $datoarray['aar'];
				
				$available = 400;
				for($i = 1; $i <= $available; $i++) {
						?><option value="<? echo $i; ?>" <? if($i == $datoarray['aar']){ echo "selected='selected'"; } ?> > <? echo $i; ?> </option><?

		
	
				}
				//skriv_aar(1, $datoarray['aar']);
			?>
			</select>





            <select style="width:150px" id="alder" name="<? echo $alder;?>">
                    <option value="50">Efter Culost' Fald (ECF)</option>
                    <option value="49">Den Gyldenrøde Tidsalder (DGT)</option>

            </select>
            <br/>
		<div class="klokken_holder">
			<a href="#" class="klokken_link" id="klokken_link" > </a>
			<p class="klokken" style="float:right;display:none;">klokken:
				<input type="text" id="time" name="<? echo $time;?>" style="width:20px;" >:
				<input type="text" id="minut" name="<? echo $minut;?>" style="width:20px;" value="00">
			</p>
		</div>

         

<?



/*
//$datoarrayet kan bruges, hvis der er en særlig dato man gerne vil have vist i tidsformen, når den hentes ind. Hvis den ikke er sat, bliver den defineret herunder:


?>
	



			
			<select style="width:50px" id="dag" class="dag" name="dag">
			<? 
			
			function skriv_dag($i, $valgt)
			{
				if($i<32)
				{
					?><option id="<? echo $i; ?>" value="<? echo $i; ?>" <?  if($i == $valgt){ echo "selected='selected'"; } ?> ><? echo $i; ?></option><?
					
					
					$this->skriv_dag($i+1, $valgt);
				}	
			}
			
			skriv_dag(1, $datoarray['dag']);
			
			?>
			</select>

			<select style="width:90px" id="maaned" class="maaned" name="maaned">
				<option value="1" <? if($datoarray['maaned'] == 1){ echo "selected='selected'"; } ?>>januar</option>
				<option value="2" <? if($datoarray['maaned'] == 2){ echo "selected='selected'"; } ?>>februar</option>
				<option value="3" <? if($datoarray['maaned'] == 3){ echo "selected='selected'"; } ?>>marts</option>
				<option value="4" <? if($datoarray['maaned'] == 4){ echo "selected='selected'"; } ?>>april</option>
				<option value="5" <? if($datoarray['maaned'] == 5){ echo "selected='selected'"; } ?>>maj</option>
				<option value="6" <? if($datoarray['maaned'] == 6){ echo "selected='selected'"; } ?>>juni</option>
				<option value="7" <? if($datoarray['maaned'] == 7){ echo "selected='selected'"; } ?>>juli</option>
				<option value="8" <? if($datoarray['maaned'] == 8){ echo "selected='selected'"; } ?>>august</option>
				<option value="9" <? if($datoarray['maaned'] == 9){ echo "selected='selected'"; } ?>>september</option>
				<option value="10" <? if($datoarray['maaned'] == 10){ echo "selected='selected'"; } ?>>oktober</option>
				<option value="11" <? if($datoarray['maaned'] == 11){ echo "selected='selected'"; } ?>>november</option>
				<option value="12" <? if($datoarray['maaned'] == 12){ echo "selected='selected'"; } ?>>december</option>
			</select>
			
			<select style="width:60px" id="aar" name="aar">
				<?

				//echo $datoarray['aar'];
				
				function skriv_aar($j, $valgt)
				{
					if($j<1000)
					{
						?>
						<option value="<? echo $j; ?>" <? if($j == $valgt){ echo "selected='selected'"; } ?> > <? echo $j; ?> </option>
						<?
						$j = $j+1;
						skriv_aar($j, $valgt);
					}
	
				}
				skriv_aar(1, $datoarray['aar']);
			?>
			</select>
         <span id="klokken" style="float:right;display:none;">klokken:
                <input type="text" id="time" name="time" style="width:20px;height:10px;" >:
                <input type="text" id="minut" name="minut" style="width:20px;height:10px;" value="00">
          </span>

            <select style="width:150px" id="alder" name="alder">
                    <option value="50">Efter Culost' Fald</option>
                    <option value="49">Den Gyldenrøde Tidsalder</option>

            </select>
         <a href="#" class="rubrik" id="klokken_link" onclick="hidestuff('klokken_link');showstuff('klokken')"> </a>




<script type="text/javascript">
$(document).ready(function() {

    function maaned_check() {

       var maaned = $('select.maaned option:selected').val();


       if(maaned == "2") {

           $("#29").hide();
           $("#29").removeAttr("selected");
           $("#30").hide();
           $("#30").removeAttr("selected");
           $("#31").hide();
           $("#31").removeAttr("selected");

       }
       else if(maaned == "4" || maaned == "6" || maaned == "9" || maaned == "11") {

           $("#29").show();
           $("#30").show();
           $("#31").hide();
           $("#31").removeAttr("selected");
       }
       else { 

           $("#29").show();
           $("#30").show();
           $("#31").show();
       }

    }

    $(window).load(maaned_check);
    $("#tid").change(maaned_check);
    
});
</script>

<? */ ?>
